import { message_message_type as PrismaMessageType } from '@prisma/client';

// 你本地定义的 MessageType 继续用 MessageType，导入的改成 PrismaMessageType


// 这样你就可以用 MessageType.text，MessageType.image 了


// 1. 定义事件名枚举
export enum SocketEvent {
  SendMessage = 'sendMessage',
  SendError = 'sendError',
  HeartBeat = 'heartbeat'
}
type MessageType = PrismaMessageType;

// 2. 定义事件参数类型映射接口
export interface SocketEventPayloads {
  [SocketEvent.SendMessage]: {
    content: string;
    roomId?: string;
    toIm_Id: string;
    messageType: MessageType;
  },
  [SocketEvent.SendError]: {
    content: string;
    messageType: MessageType
  },
  [SocketEvent.HeartBeat]: {
    content: string;
    messageType: MessageType
  }
}
